<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 教室列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="add.html"> 添加教室</a> </li>
          <li>
          	<div class="label">
          		<label>请选择搜索方式</label>
          	</div>
            <select id="serachId" name="serachId" class="input" style="width:200px; line-height:17px;">
              <option value="1">教室id</option>
              <option value="2">教室名字</option>
              <option value="3">教室位置</option>
<%--              <option value="4">教室是否已被删除</option>--%>
              <option value="5">教室创建时间</option>
              <option value="6">教室修改时间</option>
              <option value="7">教室删除时间</option>
            </select>
          </li>
        <li>
          <input type="text" id="keyWord" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" />
          <a href="javascript:changesearch()" class="button border-main icon-search"> 搜索</a></li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">教室ID</th>
        <th>教室名字</th>
        <th>教室位置</th>
<%--        <th>教室是否已被删除</th>--%>
        <th>教室创建时间间</th>
        <th width="10%">教室修改时间</th>
        <th width="10%">教室删除时间</th>
        <th width="310">操作</th>
      </tr>
      	<c:forEach items="${list}" var="sClass" varStatus="status">
      	
      	
      	
      	<tr>
          <td style="text-align:left; padding-left:20px;">
			  <input type="checkbox" name="id[]" value="" />${sClass.cId}
           </td>
          
          <td width="10%">${sClass.name}</td>
          <td>${sClass.location}</td>
<%--          <td>--%>
<%--          		<c:choose>--%>
<%--          			<c:when test="${sClass.removeFlag}">是</c:when>--%>
<%--          			<c:otherwise>不是</c:otherwise>--%>
<%--          		</c:choose>--%>
<%--		  </td>--%>
          <td>${sClass.buildTime}</td>
          <td>${sClass.editTime}</td>
          <td>${sClass.deleteTime}</td>
          <td>
          <div class="button-group"> 
          <a class="button border-main" href="SchoolClassServlet?flag=3&original-cId=${sClass.cId}"><span class="icon-edit"></span> 修改</a> &nbsp;
          <a class="button border-red" href="javascript:mydel('${sClass.cId}')" ><span class="icon-trash-o"></span> 删除</a> 
          </div>
          </td>
        </tr>
      	
      	
      	</c:forEach>
        
   		 
      <tr>
        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
          全选 </td>
        <td colspan="7" style="text-align:left;padding-left:20px;"><a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a> <a href="javascript:void(0)" style="padding:5px 15px; margin:0 10px;" class="button border-blue icon-edit" onclick="sorts()"> 排序</a> 操作：
          <select name="ishome" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeishome(this)">
            <option value="">首页</option>
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
          <select name="isvouch" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeisvouch(this)">
            <option value="">推荐</option>
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
          <select name="istop" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeistop(this)">
            <option value="">置顶</option>
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
          &nbsp;&nbsp;&nbsp;
          
          移动到：
          <select name="movecid" style="padding:5px 15px; border:1px solid #ddd;" onchange="changecate(this)">
            <option value="">请选择分类</option>
            <option value="">产品分类</option>
            <option value="">产品分类</option>
            <option value="">产品分类</option>
            <option value="">产品分类</option>
          </select>
          <select name="copynum" style="padding:5px 15px; border:1px solid #ddd;" onchange="changecopy(this)">
            <option value="">请选择复制</option>
            <option value="5">复制5条</option>
            <option value="10">复制10条</option>
            <option value="15">复制15条</option>
            <option value="20">复制20条</option>
          </select></td>
      </tr>
      <tr>
        <td colspan="8"><div class="pagelist">
         <a href="">首页</a>
         <a href="">上一页</a> 
         
         <!-- <span class="current">1</span> -->
         
         <a href="">下一页</a>
         <a href="">尾页</a> </div></td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">

function mydel(Id){
	//alert(teaId);
	if(confirm("您确定要删除吗？")){
		//alert(this);
		var str = "SchoolClassServlet?flag=2&cId=" + Id;
		location.href= str;
	}
}

//搜索
function changesearch(){	
	var keyWord = $("#keyWord").val();
	var searchId = $("#serachId").val();
	location.href="SchoolClassServlet?flag=6&id=" + searchId + "&keyWord=" + keyWord;
}


</script>
</body>
</html>